﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META   HTTP-EQUIV="Pragma"   CONTENT="no-cache">     
<META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache">     
<META   HTTP-EQUIV="Expires"   CONTENT="0">    
<#include "/pages/include/front_include.ftl" />
<@h.css href="/css/indexStyle.css"/>
<@h.css href="/css/letaoUI.css"/>
<@h.css href="/css/style.css"/>
<@h.css href="/css/buttons.css"/>
<@h.js src="/javascripts/front/base.Letao.js"/>
<@h.js src="/javascripts/front/indexUI.js"/>
<@h.js src="/javascripts/public/news.js"/>
<@h.js src="/javascripts/public/faq.js"/>
<@h.js src="/ckeditor/ckeditor.js"/>
<script type="text/javascript">
	$.ajaxSetup ({
		cache: false //close AJAX cache
	});
	var news=new news();
	var faq=new faq();
	$(function(){
		loadFaq();
		$('#context img').click(function(){
			//var img=$(this);
			//window.open(img[0].src);
			var zshowbox_img_url=$(this).attr('src');
			$('body').append('<div id="zshowbox" style="overflow:hidden;background:#000;z-index:9999;display:none;position:fixed;left:0;top:0;width:100%;height:100%;"></div><div id="zshowbox_img" style="z-index:99999;display:none;position:fixed;left:50%;top:50%;border:5px solid #777;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;box-shadow:1px 1px 5px #333,-1px -1px 5px #333;-moz-box-shadow:1px 1px 5px #333,-1px -1px 5px #333;-webkit-box-shadow:1px 1px 5px #333,-1px -1px 5px #333;"><img src="'+zshowbox_img_url+'" /></div>');
			var width=$('#zshowbox_img').width(), height=$('#zshowbox_img').height();
			width=-(width/2)+'px'; height=-(height/2)+'px';
			$('#zshowbox_img').css({"margin-left":width,"margin-top":height});
			$('#zshowbox').fadeTo("fast",0.3,function(){$('#zshowbox').show();});
			$('#zshowbox_img').fadeIn(400);
			$('body').click(function(){
				$('#zshowbox,#zshowbox_img').fadeOut(400,function(){$('#zshowbox,#zshowbox_img').remove();});
				$('body').unbind('click');
				return false;
			});
			return false;
		});
		$('#context a').click(function(){
			var a=$(this);
			var href=a.attr('href');
			if(href.indexOf("http://192.168.224.22:8080/knowledge")>=0){
				href=href.replace("http://192.168.224.22:8080/knowledge","http://stkm.genomics.cn");
				window.open(href);
				return false;
			}
			return true;
		});
	});
	
	function loadFaq(){
		faq.loadFaq(${n.id},${currentPage});
	}
	
	function loadFaq1(id,no){
		faq.loadFaq(id,no);
	}
	
	function feedback(faqId,content){
		news.feedback(faqId,content);
	}
</script>
<style type="text/css">
#docInfo p{
 	line-height:23px;
}
.aside h2{
	line-height:30px;font-weight:bold;
}
.box_con h2{
	font-weight:bold;
}
.box_con .text{
	margin:10px 0px;
}
.text div,.text p,.text span,.text h1,.text h2,.text h3,.text h4,.text h5,.text h6,.text b,.text ol,.text ul,.text li,.text dl,.text dt,.text dd,.text em,.text i,.text input{
	line-height:200%;
}
a.minibutton:link, a.minibutton:visited {
color: white;
text-decoration: none;
}
a.sliverbutton b{
	line-height:23px;
}
.text ol{
	list-style: decimal;
	margin-left:20px;
}
.text ul{
	list-style: disc;
	margin-left:20px;
}
.text li{
	list-style: inherit;
}
</style>
</head>

<body>
<!--remove oncontextmenu="return   false" onselectstart="return false"-->
<#include "/pages/include/header.ftl" />

<div class="center">
	<div id="nav" class="nav">
		<#if navCates?exists>
			当前位置：
			<#list navCates?reverse as ccc>
				<a href="${contextPath}/front/subIndex-home.action?cateId=${ccc.id?if_exists}">${ccc.name}</a> <#if ccc_has_next>></#if>
			</#list>
		</#if>
	</div>
	<div class="raside">
		<div class="mt10 box">
			<div class="content">
				<h2>当前文件信息</h2>
				<div id="docInfo">
					<p class="view">浏览：${n.browserNum?if_exists}次</p>
					<p>贡献时间：${n.publishTime?string('yyyy-MM-dd HH:mm')}</p>
					<p>贡献者： ${n.publishUserName?if_exists}</p>
					<p>分类： ${n.category?if_exists}</p>
					<p>关键词： ${n.keyword?if_exists}</p>
					<p class="c" id="FriendsCor"></p>
					<p class="c"></p>
				</div>
			</div>
		</div>
		<div style="height:10px;"></div>
		<#if n.attachPosition?exists && n.attachPosition==2>
		<div class="box">
			<div class="content">
				<div class="hd">
						<b class="f-black">
						附件</b>					
				</div>
				<div class="cd c-align">
				<#if attsPage?exists && attsPage.totalCount gt 0>
								<#list attsPage.result as a>
									<#if a.photoName?exists>
									<div style="width:190px;margin:10px 0px">
										<img style="width:190px" src="${a.photoPath}"/>
										<div>
										
										</div>
									</div>
									</#if>
									<div style="margin:4px 2px;" align="left">
										<span title="${a.attachType.name?if_exists}" 
											<#if a.attachType.name=='pdf'>
												class="pdf icon"
											<#elseif a.attachType.name=='doc'>
												class="doc icon"
											<#elseif a.attachType.name=='docx'>
												class="docx icon"
											<#elseif a.attachType.name=='ppt'>
												class="ppt icon"
											<#elseif a.attachType.name=='pptx'>
												class="pptx icon"
											<#elseif a.attachType.name=='xls'>
												class="xls icon"
											<#elseif a.attachType.name=='xlsx'>
												class="xlsx icon"
											<#elseif a.attachType.name=='wps'>
												class="wps icon"
											<#else>
												class="txt icon"
											</#if>
											></span>
											&nbsp;<span title="${a.attachName?if_exists}">
											<#if a.attachName?exists>
												<#if a.attachName?length gte 40>
													${a.attachName?substring(0,40)}...
												<#else>
													${a.attachName}
												</#if>
											</#if>
											<#if a.attachSize?exists>
											<#if a.attachSize gt 1024>
												(${(a.attachSize/1024)?string("0.##")}M)
											<#else>
												(${a.attachSize}K)
											</#if>
											下载:${a.downSum?default(0)}
											</#if>
											</span><br> 
											<div align="center">
											[
												<#if a.canPreview>
													<a target="_blank" href="${contextPath}/myfile/myfile-preview.action?attachId=${a.id?if_exists}" title="点击预览" style="color:#0169ba;">预览</a>
												<#else>
													<span style="color:gray" title="该文件不支持预览">预览</span>
												</#if>
												 |
												<a href="${contextPath}/download.action?id=${a.encodeId?if_exists}&from=2" title="点击下载" style="color:#0169ba">	下载</a>
											]
											</div>
									</div>
									<div class="clear"></div>
								</#list>
								<div class="page" style="float:right;margin-top:10px;">
					                    <#if attsPage.totalPageCount gt 1>
					                    	转到第
											<#list 1..attsPage.totalPageCount as p>
												<a href="${contextPath}/news/news-showNews.action?newsId=${n?if_exists.id?if_exists}&attaPage=${p}" class="sliverbutton"><span <#if attaPage==p>style="color:blue"</#if>>${p}</span></a>
											</#list>
											页
										</#if>
								</div>
								<div class="clear"></div>
							</#if>
					</div>
			</div>
		</div>
		</#if>
	</div>
		
		<div class="main" style="margin-bottom:10px;">
			<dl class="box_con type_top">
				<dd>
				<h2 style="text-align:center;padding:0 100px;word-wrap:break-word;">${n.title}</h2>
				<div align="center">
					${n.publishTime?string('yyyy年MM月dd日HH:mm')}
					&nbsp;&nbsp;&nbsp;&nbsp; 
					<#if  n.canFaq>
						<a href="#f" title="点击评论">我要评论(<span id="faqSum">${n.faqSum?if_exists}</span>) </a>
					</#if>
					&nbsp;&nbsp;&nbsp; 
					<#if n.isAddFavorite(userId)>
						<span style="color:gray" title="该文件已经收藏">已收藏</span> 
					<#else>
						<a id="addFavorite" href="javascript:news.addFav(${n.id?if_exists});" title="点击收藏">收藏 </a>
					</#if>
				</div>
				<div class="text" id="context">
					<#list n.content as c>
						<#if c.contentPage?exists>
		                    <#assign contPageSize=c.contentPage?size>
		                </#if>
						<#if contPageSize?exists && contPageSize gt 1>
                    		${c.contentPage?if_exists[page-1]}
                    	<#else>
                    		${c.content}
                    	</#if>
                    </#list>
				</div>
				<div class="page" style="float:right">
						<#list n.content as c>
	                    		<#if contPageSize?exists && contPageSize gt 1>
	                    			转到第
	                    			<#list 1..contPageSize as p>
	                    				<a href="${contextPath}/news/news-showNews.action?newsId=${n.id?if_exists}&page=${p}" class="sliverbutton"><span <#if page==p>style="color:blue"</#if>>${p}</span></a>
	                    			</#list>
	                    			页
	                    		</#if>
	                    </#list>
				</div>
				<#assign showatts=true >
				<#if contPageSize?exists && contPageSize gt 1>
					<#assign showatts=false>
					<#if page==contPageSize>
						<#assign showatts=true >
					</#if>
				</#if>
				<br class="clear">
				<#if showatts>
					<#if !n.attachPosition?exists || n.attachPosition==1>
						<#if attsPage?exists && attsPage.totalCount gt 0>
								<div>
									<h3>附件：</h3>
								</div>
								<#list attsPage.result as a>
									
									<div style="position:relative;margin-left:20px;line-height:100%">
										<div style="float:left;width:20px;">
										${attsPage.pageSize*(attaPage-1)+a_index+1},
										</div>
										<#if a.photoName?exists && a.photoPath?exists>
										<div style="float:left;width:200px;margin:0px 5px 10px 10px;">
											<img style="width:200px" src="${a.photoPath}"/>
											<div>
											
											</div>
										</div>
										</#if>
										<span title="${a.attachType.name?if_exists}" 
											<#if a.attachType.name=='pdf'>
												class="pdf icon"
											<#elseif a.attachType.name=='doc'>
												class="doc icon"
											<#elseif a.attachType.name=='docx'>
												class="docx icon"
											<#elseif a.attachType.name=='ppt'>
												class="ppt icon"
											<#elseif a.attachType.name=='pptx'>
												class="pptx icon"
											<#elseif a.attachType.name=='xls'>
												class="xls icon"
											<#elseif a.attachType.name=='xlsx'>
												class="xlsx icon"
											<#elseif a.attachType.name=='wps'>
												class="wps icon"
											<#else>
												class="txt icon"
											</#if>
											></span>
											&nbsp;<span title="${a.attachName?if_exists}.${a.attachType.name}">
											<#if a.attachName?exists>
												<#if a.attachName?length gte 40>
													${a.attachName?substring(0,40)}....${a.attachType.name}
												<#else>
													${a.attachName}.${a.attachType.name}
												</#if>
											</#if>
											<#if a.attachSize?exists>
											<#if a.attachSize gt 1024>
												(${(a.attachSize/1024)?string("0.##")}M)
											<#else>
												(${a.attachSize}K)
											</#if>
											</#if>
											&nbsp;
											下载:${a.downSum?default(0)}
											
											</span>&nbsp;&nbsp;&nbsp; 
											
											[
												<#if a.canPreview>
													<a target="_blank" href="${contextPath}/myfile/myfile-preview.action?attachId=${a.id?if_exists}" title="点击预览" style="color:#0169ba">预览</a>
												<#else>
													<span style="color:gray" title="该文件不支持预览">预览</span>
												</#if>
												 |
												<#if n.canDown>
													<a href="${contextPath}/download.action?id=${a.encodeId?if_exists}&from=2" title="点击下载" style="color:#0169ba">	下载</a>
												<#else>
													<span style="color:gray" title="该资讯不可下载">下载</span>
												</#if>
											]
									</div>
									<br class="clear" style="height:1px;"/>
								</#list>
								<div class="page" style="float:right">
					                    <#if attsPage.totalPageCount gt 1>
					                    	转到第
											<#list 1..attsPage.totalPageCount as p>
												<a href="${contextPath}/news/news-showNews.action?newsId=${n.id?if_exists}&attaPage=${p}" class="sliverbutton"><span <#if attaPage==p>style="color:blue"</#if>>${p}</span></a>
											</#list>
											页
										</#if>
								</div>
							</#if>
						</#if>
					</#if>
				</dd>
			</dl>
			<br style="clear:both;" />
		</div>
		<div class="main faqbox list_container">
			<div id="faqContainer" class="mt">
			</div>
		</div>
		<#if n.canFaq?exists && n.canFaq>
		<div class="main skin-category-list faq" style="margin-top:20px;">
			<div style="padding:20px 20px;">
				<a name="f"></a>
				<div class="style">
					<h2>发表评论</h2><div style="float: right; font-size: 12px; font-weight: normal;">
						你最多可以输入255个字</div>
				</div>
				<div>
					<div>
						<textarea id="faqContent" name="TextArea1" class="l-textarea" maxlength="255" rows="10" style="width:100%"></textarea>
					</div>
					<div style="float: right;margin:10px 0px;">
						<a id="FaqBtn" href="javascript:news.submitFaq(${n.id?if_exists},null,2,${n.categoryId?default('999')});" class="sliverbutton"><span>发表评论</span></a>
					</div>
				</div>
			</div>
		</div>
		</#if>
	<div class="clear">
	</div>
</div>
<#if n.canFaq?exists && n.canFaq>
<script type="text/javascript">
  CKEDITOR.replace('faqContent',{
  		skin : 'v2',
		toolbar : [ [ 'Bold', 'Italic' ], ['Smiley'] ]
	}); 
</script>
</#if>
<#include "/pages/include/footer.ftl" />
</body>

</html>
